home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / BOI200P.ZIP / IOSUPP.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-14  |  2KB  |  76 lines

  1. { $D-}
  2. {$S-}
  3. {$V-}
  4.  
  5. Unit IOSupp;
  6.  
  7. INTERFACE
  8.  
  9. Procedure CHECKSECONDKEY( { process function keys }
  10.     cskey : char);          { function key scan code }
  11.  
  12. IMPLEMENTATION
  13.  
  14. Uses
  15.   BOIDecl,
  16.   Async,
  17.   IOLib;
  18.  
  19. Const
  20.   null = #$00;
  21.   F2   = #$3C;
  22.   F7   = #$41;
  23.   F8   = #$42;
  24.   F9   = #$43;
  25.   F10  = #$44;
  26.  
  27. Procedure CHECKSECONDKEY(cskey : char);
  28.   { this procedure Aborts the program if F-10 is pressed from the local }
  29.   { keyboard }
  30.   var
  31.     cloop : byte;
  32.  
  33.   begin {* CheckSecondKey *}
  34.     if (cskey = f2) and not boi_local then
  35.       begin { toggle remote user status line info }
  36.         if boi_statmode = sm_time then boi_statmode := sm_help1
  37.         else if boi_statmode = sm_help1 then boi_statmode := sm_comm
  38.         else if boi_statmode = sm_comm then boi_statmode := sm_vid
  39.         else if boi_statmode = sm_vid then boi_statmode := sm_time;
  40.         UpdateStatLine
  41.       end
  42.     else if (cskey = f7) and boi_usetime then
  43.       begin { decrease user time remaining by one minute }
  44.         Dec(boi_ticks,1092);
  45.         boi_timeover := (boi_ticks <= 0);
  46.         if boi_statmode = sm_time then UpdateStatLine
  47.       end
  48.     else if (cskey = f8) and boi_usetime then
  49.       begin { increase user time remaining by one minute }
  50.         Inc(boi_ticks,1092);
  51.         if boi_statmode = sm_time then UpdateStatLine
  52.       end
  53.     else if cskey = f9 then
  54.       begin { boot user off line with simulated line noise }
  55.         if not boi_local then
  56.           begin
  57.             for cloop := 1 to Random(15) + 8 do
  58.                 SendString(Chr(Random(222)+33),false);
  59.             SendString(#7,false);
  60.             DropCarrier
  61.           end;
  62.         Halt
  63.       end
  64.     else if cskey = f10 then
  65.       begin { force exit of game back to BBS }
  66.         PortWindow(1,1,80,boi_pagelength);
  67.         ClrPortScr;
  68.         SendString('The SysOp has terminated this program.',true);
  69.         SendString('Please standby as control returns to the BBS.',false);
  70.         Halt
  71.       end
  72.     else cskey := null
  73.   end;  {* CheckSecondKey *}
  74.  
  75. begin {* uIOSupp *}
  76. end.  {* uIOSupp *}